/**
 * Created by Administrator on 2017/8/16.
 */
var map;
var myCenter = new google.maps.LatLng(29.568381,106.552219);//重庆
function CoordMapType() {
}
CoordMapType.prototype.tileSize = new google.maps.Size(256,256);
CoordMapType.prototype.maxZoom = 19;

CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
    console.log('CoordMapType.prototype.getTile');
    var div = ownerDocument.createElement('div');
    div.innerHTML = '<img name="" src="./tiles/' + zoom + '/' + coord.x + '/' + coord.y + '.png"/>';
    div.style.width = this.tileSize.width + 'px';
    div.style.height = this.tileSize.height + 'px';
    div.style.fontSize = '10';
    div.style.borderStyle = 'solid';
    div.style.borderWidth = '1px';
    div.style.borderColor = '#AAAAAA';
    return div;
};



CoordMapType.prototype.name = "Tile #s";
CoordMapType.prototype.alt = "Tile Coordinate Map Type";

var coordinateMapType = new CoordMapType();

function initialize() {
    var mapOptions = {
        zoom: 10,
        center: myCenter,
        mapTypeId: "coordinate"
    };
    map = new google.maps.Map(document.getElementById("map_canvas"),
        mapOptions);

    map.mapTypes.set('coordinate',coordinateMapType);
}